/*
 * Selling Partner API for Product Type Definitions
 *
 * The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds).  For more information, see the [Product Type Definitions API Use Case Guide](doc:product-type-api-use-case-guide).
 *
 * The version of the OpenAPI document: 2020-09-01
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = software.amzn.spapi.Client.OpenAPIDateConverter;

namespace software.amzn.spapi.Model.productTypeDefinitions.v2020_09_01
{
    /// <summary>
    /// The version details for an Amazon product type.
    /// </summary>
    [DataContract(Name = "ProductTypeVersion")]
    public partial class ProductTypeVersion : IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductTypeVersion" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ProductTypeVersion() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductTypeVersion" /> class.
        /// </summary>
        /// <param name="varVersion">Version identifier. (required).</param>
        /// <param name="latest">When true, the version indicated by the version identifier is the latest available for the Amazon product type. (required).</param>
        /// <param name="releaseCandidate">When true, the version indicated by the version identifier is the prerelease (release candidate) for the Amazon product type..</param>
        public ProductTypeVersion(string varVersion = default(string), bool latest = default(bool), bool releaseCandidate = default(bool))
        {
            // to ensure "varVersion" is required (not null)
            if (varVersion == null)
            {
                throw new ArgumentNullException("varVersion is a required property for ProductTypeVersion and cannot be null");
            }
            this.VarVersion = varVersion;
            this.Latest = latest;
            this.ReleaseCandidate = releaseCandidate;
        }

        /// <summary>
        /// Version identifier.
        /// </summary>
        /// <value>Version identifier.</value>
        [DataMember(Name = "version", IsRequired = true, EmitDefaultValue = true)]
        public string VarVersion { get; set; }

        /// <summary>
        /// When true, the version indicated by the version identifier is the latest available for the Amazon product type.
        /// </summary>
        /// <value>When true, the version indicated by the version identifier is the latest available for the Amazon product type.</value>
        [DataMember(Name = "latest", IsRequired = true, EmitDefaultValue = true)]
        public bool Latest { get; set; }

        /// <summary>
        /// When true, the version indicated by the version identifier is the prerelease (release candidate) for the Amazon product type.
        /// </summary>
        /// <value>When true, the version indicated by the version identifier is the prerelease (release candidate) for the Amazon product type.</value>
        [DataMember(Name = "releaseCandidate", EmitDefaultValue = true)]
        public bool ReleaseCandidate { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class ProductTypeVersion {\n");
            sb.Append("  VarVersion: ").Append(VarVersion).Append("\n");
            sb.Append("  Latest: ").Append(Latest).Append("\n");
            sb.Append("  ReleaseCandidate: ").Append(ReleaseCandidate).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
